According to a conventionally known switch of this kind, a light emitting element and a light receiving element are disposed laterally opposite to each other in a casing, and a plunger having a light shield is received in the casing in an axially slidable manner. The plunger is normally urged outwardly by a return spring and a light beam produced from the light emitting element can reach the light receiving element. When the plunger is depressed against the biasing force of the return spring, the light shield obstructs the path of the light beam, and relatively less light is projected upon the light receiving element. By detecting the output level of the light receiving element, the mechanical state of the plunger may be detected without using any contacts which would be subjected to wears.
However, according to this structure, since the light shield moves across the path of the light beam, the plunger necessarily extends perpendicularly with respect to the light beam, and the dimensions thereof in these two directions tend to be large.
Further, since the switch output is obtained by the light shield shutting off the light beam, if the diameter of the light beam is large, it takes some time before the light beam is completely shut off by the light shield, and the response speed of the switch output is delayed. Conversely, if the diameter of the light beam is small, the actuation stroke of the plunger would be reduced, and this is not favorable because the point of activation of the switch cannot be accurately determined and it becomes difficult to exactly adjust how far the plunger is required to be depressed for a switch output to be produced.
Furthermore, according to such a contactless switch, only one switch output can be obtained by using a combination of a light emitting element, a light receiving element and a light shield. Therefore, when it is desired to obtain switch outputs at a plurality of points in the stroke of the plunger, a corresponding number of combinations of a light emitting element, a light receiving element and a light shield are required.
Also, in some applications, it is desired to achieve a certain linearity between the stroke of the plunger and the output level of the switch but none of the commercially available contactless switches can provided any such desired linearity.